package com.bdq.user.infrastructure.persistence.mysql.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bdq.user.infrastructure.persistence.mysql.pojo.UserFollow;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author malei
* @description 针对表【user_follow(用户关注关系表)】的数据库操作Service
* @createDate 2024-06-08 15:22:47
*/
public interface UserFollowService extends IService<UserFollow> {

    /**
     * @param followerUserId
     * @param followedUserIds
     * @return
     */
    List<UserFollow> list(Long followerUserId, List<Long> followedUserIds);

    /**
     * @param followerUserId
     * @param followedUserId
     * @return
     */
    UserFollow get(Long followerUserId, Long followedUserId);

    /**
     * 关注数
     *
     * @param userId
     * @return
     */
    Long getFollowerNum(Long userId);

    /**
     * 被关注数
     *
     * @param userId
     * @return
     */
    Long getFollowedNum(Long userId);

    /**
     * 互相关注数
     *
     * @param userId
     * @return
     */
    Long getEachFollowerNum(Long userId);

    /**
     * 关注列表
     *
     * @param userId
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<UserFollow> pageFollower(Long userId, Integer pageNo, Integer pageSize);

    /**
     * 被关注列表
     *
     * @param userId
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<UserFollow> pageFollowed(Long userId, Integer pageNo, Integer pageSize);

    /**
     * 互相关注列表
     *
     * @param userId
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<UserFollow> pageEachFollower(Long userId, Integer pageNo, Integer pageSize);
}
